package org.example.chapter1;

import org.example.util.Util;
import redis.clients.jedis.Jedis;

/**
 * 位操作
 */
public class HW1_5_4_Bitfield {

    public static void main(String[] args) {
        Jedis jedis = Util.getJedis();
        String key = "test";
        String u8 = "u8";
        String offset_0 = "0";
        String offset_8 = "8";
        String get = "get";
        String set = "set";
        String a = "97";
        String b = "98";
        String incrby = "incrby";
        String incr = "1";
        // 初始为hello
        jedis.set(key, "hello");
        System.out.println(jedis.get(key));
        // 同时设置第1位和第2位
        System.out.println(jedis.bitfield(key, set, u8, offset_0, a, incrby, u8, offset_8, incr));
        System.out.println(jedis.get(key));
    }


}
